-
Notifications
You must be signed in to change notification settings - Fork 23
[DPE-7603][DPE-6990] Fix check in relation initialisation #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1054 +/- ##
=======================================
Coverage 73.29% 73.29%
=======================================
Files 15 15
Lines 3921 3921
Branches 574 574
=======================================
Hits 2874 2874
Misses 833 833
Partials 214 214 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
We'll most probably need to remove the old cla-check to be able to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is a nice catch!
…-initialisation Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Issue
The handler for the
database_requested
event creates a new user through the primary, but checks if the current unit is has started PostgreSQL. The current unit may be the leader but not the primary, which may lead to errors when trying to access the database.There is also the case where, for some reason, the K8s PG primary service stops redirecting traffic to the unit for a short period. This makes the charm understand that the cluster has initialised completely and can create users (but it may not due to that weird situation). This still needs further investigation.
Solution
Use the right condition (primary endpoint being ready) in the check.
Fixes #1011
Fixes #927
Checklist